Calling the Generic Find/Replace/Goto Dialog Box

Description

This script illustrates how to use the A5_GENERICSEARCHREPLACE() function with the contents of a text box. The beginning of the script defines the title of the dialog box and the text that it will display. Note that the text is placed into .text sub-element of the ptext pointer variable.

dlg_title = "Adding Find/Replace/Goto to a Dialog Box"
dim ptext as P
dim ptext.object as P
dim ptext.text as C
ptext.text = <<%a%
Starsky & Hutch," the Todd Phillips film adaptation of the 1970's television series, may not spark yet another 1970's fashion moment, but it is bound to do more for the Tijuana hippie sweater than any number of revivals on the runways. The return of that emblem of boho chic would not surprise Louise Mingenbach, the film's costume designer, who recreated the sweater and other period artifacts, including the leather jackets and flares worn by the maverick detectives: Starsky (Ben Stiller) and his sidekick, Ken Hutchinson (Owen Wilson), better known as Hutch.
Ms. Mingenbach, 40, studied art history before cutting her teeth on films like "The Usual Suspects." But her curatorial regard for the 70's was fed by monthly visits to the Rose Bowl swap meet in Los Angeles, a funky bazaar where people sell their wardrobe castoffs, and her perusal of vintage Sears catalogs. Sears, she said, represented what Middle America actually wore, "even the leisure suits."
(c) New York Times 2004
%a%

The call to A5_GENERICSEARCHREPLACE()passes the pointer variable that contains the text and the argument that defines which dialog pane to display.

ui_dlg_box(dlg_title,<<%dlg%
{startup=init}
{font=courier new,10}
[%MAW;K%.150,10ptext];
{font=}
<Find> <Replace> <Goto>;
%dlg%,<<%code%
if a_dlg_button = "find" .or. a_dlg_button = "replace" .or. a_dlg_button = "goto" then
    A5_GenericSearchReplace(ptext, a_dlg_button)
    a_dlg_button = ""
end if
%code%)

Limitations

Desktop applications only

See Also